
#include "StaticSprite.h"
#include "DynamicSprite.h"
#include "Projectile.h"
#include "Circle.h"
#include "GameEngine.h"
#include "Ball.h"
#include "Rectangle.h"

using namespace std;
using namespace gaim;

void up2(void *up);
void down2(void *down);

int main( int argc, char* args[] )
{
    
    //nonsens!
    Image im, im3 = Image("trollface.png", true);
    //end nonsens
    
    Image bv("border_v.jpg", false);
    Image bh("border_h.jpg", false);
    Image b("BOLL.jpg", false);
    
    map<string, Image> m;
    m.insert(make_pair("border_v", bv));
    m.insert(make_pair("border_h", bh));
    m.insert(make_pair("boll", b));
    
    Sprite* bv1 = StaticSprite::getInstance(m, "border_v", Point2(11, 200), 0, true);
    Sprite* bv2 = StaticSprite::getInstance(m, "border_v", Point2(389, 200), 0, true);
    
    Sprite* bh1 = StaticSprite::getInstance(m, "border_h", Point2(200, 11), 0, true);
    Sprite* bh2 = StaticSprite::getInstance(m, "border_h", Point2(200, 389), 0, true);
    
    DynamicSprite* ball = Ball::getInstance(Point2(320, 350), m, false);
    DynamicSprite* ball2 = Ball::getInstance(Point2(320, 350), m, false);
    DynamicSprite* ball3 = Ball::getInstance(Point2(320, 350), m, false);
    DynamicSprite* ball4 = Ball::getInstance(Point2(320, 350), m, false);
    
    GameEngine ge(30, 100, 100, 400, 400);
    
    ge.add(bv1);
    ge.add(bv2);
    ge.add(bh1);
    ge.add(bh2);
    
    ge.add(ball);
    ge.add(ball2);
    ge.add(ball3);
    ge.add(ball4);
    
    ge.registerEvent("key up space", up2);
    ge.registerEvent("key down space", down2);   
    
    ge.run();
    
    return 0;
}

void up2(void * up){
     cout << "up" << endl;
}

void down2(void * down){
     cout << "down" << endl;
}
